﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraBars;

namespace Leadyo.Library.CommonClass
{
   public  class ToolBarItemShortcutKey
    {
        public static BarShortcut ToolBarShortcutItem(string ShortCut)
        {
            BarShortcut barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A));

            if (ShortCut.ToLower().Contains("&a"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.A));
            else if (ShortCut.ToLower().Contains("&b"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.B));
            else if (ShortCut.ToLower().Contains("&c"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.C));
            else if(ShortCut.ToLower().Contains("&d"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D));
            else if (ShortCut.ToLower().Contains("&e"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E));
            else if (ShortCut.ToLower().Contains("&f"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F));
            else if (ShortCut.ToLower().Contains("&g"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G));
            else if (ShortCut.ToLower().Contains("&i"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I));
            else if (ShortCut.ToLower().Contains("&j"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.J));
            else if (ShortCut.ToLower().Contains("&k"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.K));
            else if (ShortCut.ToLower().Contains("&l"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.L));
            else if (ShortCut.ToLower().Contains("&m"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.M));
            else if (ShortCut.ToLower().Contains("&n"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N));
            else if (ShortCut.ToLower() .Contains("&p"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.P));
            else if (ShortCut.ToLower() .Contains("&q"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Q));
            else if (ShortCut.ToLower() .Contains("&r"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R));
            else if (ShortCut.ToLower() .Contains("&s"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S));
            else if (ShortCut.ToLower() .Contains("&t"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.T));
            else if (ShortCut.ToLower() .Contains("&v"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.V));
            else if (ShortCut.ToLower() .Contains("&w"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.W));
            else if (ShortCut.ToLower() .Contains("&x"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.X));
            else if (ShortCut.ToLower() .Contains("&y"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Y));
            else if (ShortCut.ToLower() .Contains("&z"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Z));
            else if (ShortCut.ToLower().Contains("&f1"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1));
            else if (ShortCut.ToLower().Contains("&f2"))
                barShortcut = new DevExpress.XtraBars.BarShortcut((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F2));
            return barShortcut;
        }
    }
}
